/**
 * 
 */
package br.coppe.coimbra.document.doc;

import java.io.File;

import br.coppe.coimbra.document.doc.type.Doc;
import br.coppe.coimbra.document.doc.type.Txt;

/**
 * @author phillipe
 *
 */
public class DocumentReader {

	private DocumentReader() {}
	
	public static String read(File document) {
		
		DocIF docIf = null;
		
		if (document.getName().endsWith(".txt"))
			docIf = new Txt(document);
		else if (document.getName().endsWith(".doc"))
			docIf = new Doc(document);
		
		return docIf.read();
	}
}
